
import {NgModule} from '@angular/core';
import {RouterModule, Routes} from "@angular/router";
import {LocationStrategy, PathLocationStrategy} from "@angular/common";
import {AuthGuardService} from "@shared/service/auth-guard/auth-guard.service";



const routes: Routes = [
  {
    path: 'news',
    loadChildren: 'app/pages/news/news.module#NewsModule',
  },
  {
    path: 'feed',
    loadChildren: 'app/pages/feed/feed.module#FeedModule'
  },
  {
    path: 'auth',
    loadChildren: 'app/pages/auth/auth.module#AuthModule'
  },
  /*  {
      path: 'homepage',
      loadChildren: 'app/pages/homepage/homepage.module#HomepageModule'
    },*/
  {
    path: 'mine',
    canActivateChild: [AuthGuardService],
    loadChildren: 'app/pages/mine/mine.module#MineModule',
  },
  {
    path: 'video',
    loadChildren: 'app/pages/video/video.module#VideoModule'
  },
  {
    path: 'match',
    loadChildren: 'app/pages/match/match.module#MatchModule',
  },
  {
    path: 'payment',
    loadChildren: 'app/pages/payment/payment.module#PaymentModule',
  },
  {
    path: 'sign-up',
    loadChildren: 'app/pages/sign-up/sign-up.module#SignupModule',
  },
  {
    path: 'share',
    loadChildren: 'app/pages/share/share.module#ShareModule',
  },
  {
    path: 'sharing',
    loadChildren: 'app/pages/sharing/sharing.module#SharingModule',
  },
  {
    path: 'goods',
    loadChildren: 'app/pages/goods/goods.module#GoodsModule'
  },
  {
    path: 'order',
    loadChildren: 'app/pages/order/order.module#OrderModule'
  },
  {
    path: 'crowd',
    loadChildren: 'app/pages/crowd/crowd.module#CrowdModule'
  },
  {
    path: 'credit',
    loadChildren: 'app/pages/credit/credit.module#CreditModule'
  },
  {
    path: 'redirection',
    loadChildren: 'app/pages/redirection/redirection.module#RedirectionModule'
  },
  {
    path: 'community',
    loadChildren: 'app/pages/community/community.module#CommunityModule'
  },
  {
    path: 'train',
    loadChildren: 'app/pages/train/train.module#TrainModule'
  },
  {
    path: 'sale',
    loadChildren: 'app/pages/sale/sale.module#SaleModule'
  },
  {
    path: 'partner',
    loadChildren: 'app/pages/partner/partner.module#PartnerModule'
  },
  {
    path: '',
    loadChildren: 'app/pages/mix/mix.module#MixModule'
  },
  {
    path: 'haggle',
    loadChildren: 'app/pages/haggle/haggle.module#HaggleModule'
  },
  {
    path: ':userId',
    loadChildren: 'app/pages/homepage/homepage.module#HomepageModule'
  },
  { path: '**', redirectTo: '/' },

];

// preloadingStrategy: PreloadAllModules

@NgModule({
  imports: [
    RouterModule.forRoot(routes)
  ],
  exports: [RouterModule],

})
export class AppRoutingModule {
}
